package com.foo.quartz.task;

import com.foo.wechat.domain.WxOrder;
import com.foo.wechat.domain.WxPoultry;
import com.foo.wechat.service.IWxOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.foo.common.utils.StringUtils;

import java.util.List;

/**
 * 定时任务调度测试
 *
 * @author foo
 */
@Component("ryTask")
public class RyTask
{
    @Autowired
    private IWxOrderService wxOrderService;
    public void ryNoParams()
    {
        WxOrder wxOrder = new WxOrder();
        wxOrder.setOrderState(0L);
        List<WxOrder> list = wxOrderService.selectWxOrderList(wxOrder);
        for (WxOrder wxOrder1 : list){
            WxPoultry wxPoultry = wxOrder1.getWxPoultry();
            WxOrder wxOrder2 = new WxOrder();
            wxOrder2.setOrderId(wxOrder1.getOrderId());
            wxOrder2.setOrderNodayfee(wxOrder1.getOrderNodayfee().add(wxPoultry.getPoultryDayFee()));
            wxOrderService.updateWxOrder(wxOrder2);
        }

        System.out.println("执行无参方法");
    }
}
